pkgname=nginx-server
pkgver=1.14
pkgrel=2
arch=('i386' 'x86_64')
url="https://nginx.org"
license=('BSD')
nginx_name=("nginx-${pkgver}.${pkgrel}")
source=("https://nginx.org/download/${nginx_name}.tar.gz" "blacklist.conf")
md5sums=('SKIP' 'SKIP')

build()
{
	benchmark_path="/lkp/benchmarks/${pkgname}"
	mkdir -p "${benchmark_path}"
	cd "${srcdir}/${nginx_name}"
	./configure --with-http_ssl_module --prefix="${benchmark_path}"
	make -j4
}

package()
{
	mkdir -p "$pkgdir/rootfs/addon/etc/modprobe.d/"
	cp blacklist.conf "$pkgdir/rootfs/addon/etc/modprobe.d/"

	mkdir -p "$pkgdir/lkp/benchmarks/${pkgname}/"
	cp -r "$LKP_SRC/pkg/${pkgname}/nginx_conf" "$pkgdir/lkp/benchmarks/${pkgname}/"

	cd "${srcdir}/${nginx_name}"
	make install DESTDIR="${pkgdir}"
}
